//
// Created on 2025/1/13.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#ifndef CANVASTEST_DRAWTESTING_H
#define CANVASTEST_DRAWTESTING_H

#include <arkui/drawable_descriptor.h>
#include <multimedia/image_framework/image_pixel_map_mdk.h>
#include <native_drawing/drawing_text_declaration.h>
#include <native_drawing/drawing_types.h>
#include <vector>


class DrawTesting {
public:
    DrawTesting();
    ~DrawTesting();
    void SetDrawCanvas(OH_Drawing_Canvas* canvas);
    void DrawList(float x, float y, float width, float height, const char* string, OH_Drawing_PixelMap *pixelmap);
    void DrawPicture(float x, float y, float width, float height, OH_Drawing_PixelMap *pixelmap);
    void DrawLists(float x, float y, float width, float height, int num);
    void DrawText(float x, float y,  float max_width, const char *string);
    void TouchMove(int touchType, int x, int y);
    
    void AddPixelmap(NativePixelMap *pixelmap);

private:
    OH_Drawing_Canvas* canvas = nullptr;
    
    std::string GetIndexString(int index);
    std::vector<std::string> all_strings;
    
    int lastX = 0, lastY = 0;
    int nowY = 0;
    
    OH_Drawing_FontCollection *font_collection = nullptr;
    
    std::vector<NativePixelMap *> all_pixelmaps;
    std::vector<OH_Drawing_PixelMap *> all_pixelmaps_image;
};

#endif //CANVASTEST_DRAWTESTING_H
